﻿using BySoft.Server.Common.Entity;
using BySoft.Server.Common.Schema;
using BySoft.Server.DataAccess;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;


//==================================================================================
//
//        Copyright (C) 2014-2016 SRC Studio   
//        All rights reserved
//
//        Filename :Product
//
//        Created by Administrator at  2016-05-20 22:39:13
//        http://www.seven-rosy-clouds.com
//
//        Description :  
//
//        Change History :
//
//	Version    Date                      Author           Description  
// ----------------------------------------------------------------------------------
//  	1.0  2016-05-20 22:39:13        Administrator    Created.
//   
//
//===================================================================================

namespace BySoft.Server.Business
{

    public partial class MdMaterial : BusinessEntityBase<MdMaterialEntity>
    {
        public MdMaterial()
        {
            EntityTableProperty = new EntityProperty()
            {
                TableName = "MD_Material",
                IDString = "MaterialID",
                NameString = "MaterialName"
            };
        }
    


      public static DataTable SelectList(string MaterialID, string MaterialName, string MatTypeID, string Status, int pageIndex, int pageSize, out int m_count)
      {
          return MdMaterialDA.SelectList(MaterialID, MaterialName, MatTypeID, Status, pageIndex, pageSize, out m_count);
      }

      public static bool IsExistsNameSpecifications(string strMaterialName, string strSpecifications)
      {
          return MdMaterialDA.IsExistsNameSpecifications(strMaterialName, strSpecifications);
      }

      public static bool SaveMdMaterialAttachment(MdMaterialEntity entity, List<MdAttachmentEntity> lstyFile)
      {
          return MdMaterialDA.SaveMdMaterialWithAttachment(entity, lstyFile,true);
            
      }
      public static bool UpdateMdMaterialAttachment(MdMaterialEntity entity, List<MdAttachmentEntity> lstyFile)
      {
          return MdMaterialDA.SaveMdMaterialWithAttachment(entity, lstyFile, false);

      }

    }
}
